package yxy.cherry.battle.module.record.result;

public enum BattleResult {

	//战斗更详细结果 11 左完胜 12 左大胜 13 左胜利 14 左险胜 21 右完胜 22 右大胜 23 右胜利 24 右险胜

	LEFT_WIN(1), RIGHT_WIN(2), DRAW(3),LEFT_WIN_DEFEAT(11),LEFT_WIN_WHUP(12),LEFT_WIN_WIN(13),LEFT_WIN_NARROW(14),RIGHT_WIN_DEFEAT(21),RIGHT_WIN_WHUP(22),RIGHT_WIN_WIN(23),RIGHT_WIN_NARROW(24);

	private int number;

	private BattleResult(int number) {
		this.number = number;
	}

	public int getNumber() {
		return number;
	}

	public static BattleResult battleResult(String str){
		BattleResult br = LEFT_WIN;
		switch (str){
			case "LEFT_WIN":
				return LEFT_WIN;
			case "RIGHT_WIN":
				return RIGHT_WIN;
			case "LEFT_WIN_DEFEAT":
				return LEFT_WIN_DEFEAT;
			case "LEFT_WIN_WHUP":
				return LEFT_WIN_WHUP;
			case "LEFT_WIN_WIN":
				return LEFT_WIN_WIN;
			case "LEFT_WIN_NARROW":
				return LEFT_WIN_NARROW;
			case "RIGHT_WIN_DEFEAT":
				return RIGHT_WIN_DEFEAT;
			case "RIGHT_WIN_WHUP":
				return RIGHT_WIN_WHUP;
			case "RIGHT_WIN_WIN":
				return RIGHT_WIN_WIN;
			case "RIGHT_WIN_NARROW":
				return RIGHT_WIN_NARROW;
			case "DRAW":
				return DRAW;
			default:
				return DRAW;
		}
	}

	public int getOppositeNumber(){
		switch (number){
			case 1:
				return 2;
			case 2:
				return 1;
			case 11:
				return 21;
			case 12:
				return 22;
			case 13:
				return 23;
			case 14:
				return 24;
			case 21:
				return 11;
			case 22:
				return 12;
			case 23:
				return 13;
			case 24:
				return 14;
			default:
				return 3;
		}
	}

}
